	<div id="7" class="cptab">
	<h2>Update Checker</h2>
	<p>Check for available updates from Deluxe Themes. It is recommended to keep your theme up-to-date.</p>
	<p><strong>To prevent abuse from this tool you can check for new updates once every 24 hours.</strong></p>
	
	<?php
	$old = ARRAY();
	$objDOM = new DOMDocument();
	$objDOM->load(TEMPLATEPATH."/data.xml");
	$note = $objDOM->getElementsByTagName("wptheme");
	foreach($note as $value) :
	$names = $value->getElementsByTagName("name");
	$name  = $names->item(0)->nodeValue;
	$versions = $value->getElementsByTagName("version");
	$version  = $versions->item(0)->nodeValue;
	?>
	<fieldset><legend>Installed Release</legend>
	<label>Theme Name</label>
	<span class="note"><?php echo $name; ?></span>
	<div class="clear"></div>
	<label>Theme version</label>
	<span class="note"><?php echo $version; array_push($old, $version); ?></span>
	<div class="clear"></div>
	</fieldset>
	<?Php endforeach; ?>
	
	<?php
	if ($_GET['do'] == 'check_for_updates' && $_COOKIE['update_on'] == 0) :
	$objDOM = new DOMDocument();
	$objDOM->load("http://deluxethemes.com/updater/data.xml");
	$note = $objDOM->getElementsByTagName("wptheme");
	foreach($note as $value) :
	$names = $value->getElementsByTagName("name");
	$name  = $names->item(0)->nodeValue;
	$versions = $value->getElementsByTagName("version");
	$version  = $versions->item(0)->nodeValue;
	$downloads = $value->getElementsByTagName("download");
	$download  = $downloads->item(0)->nodeValue;
	if (preg_match('/^Comfy Magazine Plus/', $name)) :
	?>
	<fieldset><legend>Latest Release</legend>
	<label>Theme Name</label>
	<span class="note"><?php echo $name; ?></span>
	<div class="clear"></div>
	<label>Theme version</label>
	<?php if ($version > $old[0]) : ?>
	<span class="note"><strong><?php echo $version; ?></strong></span><span class="note"><a href="<?php echo $download; ?>">new update available</a></span>
	<?php else : ?>
	<span class="note"><?php echo $version; ?></span>
	<?php endif; ?>
	<div class="clear"></div>
	</fieldset>
	<?php endif; endforeach; endif; ?>
	
	<?php if ($_COOKIE['update_on'] == 0) : ?>
	<p><a href="?page=<?php echo $_GET['page']; ?>&do=check_for_updates">Check for updates</a></p>
	<?php else : ?>
	<p>You have checked for new updates once in the last 24 hours already. Please be patient.</p>
	<?php endif; ?>
	
	</div>